# shellcheck shell=bash disable=SC2034,SC2154
# Maintainer: {{ g:snips_author }} <{{ g:snips_email }}>
_pkgname={{ substitute(expand('%:p:h:t'), '-git$', '', '') }}
pkgname=$_pkgname-git
pkgver=0.0.1
pkgrel=1
pkgdesc=""
arch=(any)
url={{ g:snips_github }}/$_pkgname
license=(GPL3)
makedepends=(git)
source=("git+$url#tag=")
sha256sums=(SKIP)

pkgver() {
	cd "$_pkgname" || return 1
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd "$_pkgname" || return 1

	cargo build
}

package() {
	cd "$_pkgname" || return 1

	install -D "$_pkgname" -t "$pkgdir/usr/bin"
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$_pkgname"
}
